#define  _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	int arr[100];
	int index=0,a;
	int i,j;
	while (scanf("%d", &a) != EOF)
	{
		arr[index++] = a;
		char c = getchar();
		if (c == '\n')
		{
			break;
		}
	}
	int val;
	scanf("%d", &val);
	for (i = 0; i < index; i++)
	{
		int k = i;
		for (j = i+1; j < index; j++)
		{
			if ((arr[k] +arr[j] )== val)
			{
				printf("%d %d", arr[k], arr[j]);
				break;
			}
		}
	}
	return 0;
}